package org.jsoft.servlet;

import java.io.IOException;
import java.util.TreeMap;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jsoft.dao.SellDAO;

public class showGatherAll extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5166373895363736327L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		this.doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub

		SellDAO dao = new SellDAO();

		TreeMap<String, String> map = dao.querySellMoneyGroupByYear();

		req.setAttribute("yearMap", map);

		String path = req.getContextPath();

		System.out.println(path);

		req.getRequestDispatcher("/jsp/yearKgraph.jsp").forward(req, resp);
	}

}
